package quizman.domain;
public class NumericQuestion extends Question {
	private double lowerBound;
	private double upperBound;

	public NumericQuestion(String name)
	{
		super(name);		
	}

	public NumericQuestion(String name, String text)
	{
		super(name,text);		
	}

	/**
	 * @param upperBound the upperBound to set
	 */
	public void setUpperBound(double upperBound) {
		this.upperBound = upperBound;
	}

	/**
	 * @return the upperBound
	 */
	public double getUpperBound() {
		return upperBound;
	}

	/**
	 * @param lowerBound the lowerBound to set
	 */
	public void setLowerBound(double lowerBound) {
		this.lowerBound = lowerBound;
	}

	/**
	 * @return the lowerBound
	 */
	public double getLowerBound() {
		return lowerBound;
	}
	public String getFormHtml()
	{
		return "<input type=\"text\" name=\"" + getName() + "\" value=\"\"> <br><br>\n"+
		"Lower Bound: " + getLowerBound() + "<br>\n"+
		"Upper Bound: " + getUpperBound() + "<br>\n";
	}
	
	public String getEditFormHtml()
	{
		return "<input type=\"hidden\" name=questionType value=\"" + this.getClass().getSimpleName() + "\">\n" +
				"<label for=\"lowerBound\">Lower Bound:</label> <input type=\"text\" name=\"lowerBound\" value=\""+this.getLowerBound() + "\"><br>\n" + 
				"<label for=\"upperBound\">Upper Bound:</label> <input type=\"text\" name=\"upperBound\" value=\""+this.getUpperBound() + "\"><br>\n";
	}
}
